<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template small_vector_base</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../boost_container_header_reference.html#header.boost.container.small_vector_hpp" title="Header &lt;boost/container/small_vector.hpp&gt;">
<link rel="prev" href="small_vector_allocator.html" title="Class template small_vector_allocator">
<link rel="next" href="small_vector_storage.html" title="Struct template small_vector_storage">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="small_vector_allocator.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_header_reference.html#header.boost.container.small_vector_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="small_vector_storage.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.container.small_vector_base"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template small_vector_base</span></h2>
<p>boost::container::small_vector_base</p>
</div>
<h2 class="refsynopsisdiv-title">Synopsis</h2>
<div class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../boost_container_header_reference.html#header.boost.container.small_vector_hpp" title="Header &lt;boost/container/small_vector.hpp&gt;">boost/container/small_vector.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">typename</span> SecAlloc<span class="special">,</span> <span class="keyword">typename</span> Options<span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="small_vector_base.html" title="Class template small_vector_base">small_vector_base</a> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">container</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">A</span><span class="special">,</span> <span class="identifier">Options</span> <span class="special">&gt;</span> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <span class="identifier">real_allocator</span><span class="special">&lt;</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">SecAlloc</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span>                                              <a name="boost.container.small_vector_base.allocator_type"></a><span class="identifier">allocator_type</span><span class="special">;</span>      
  <span class="keyword">typedef</span> <a class="link" href="allocator_traits.html" title="Struct template allocator_traits">allocator_traits</a><span class="special">&lt;</span> <span class="identifier">allocator_type</span> <span class="special">&gt;</span><span class="special">::</span><span class="keyword">template</span> <span class="identifier">portable_rebind_alloc</span><span class="special">&lt;</span> <span class="keyword">void</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span> <a name="boost.container.small_vector_base.void_allocator_t"></a><span class="identifier">void_allocator_t</span><span class="special">;</span>    
  <span class="keyword">typedef</span> <a class="link" href="dtl/get_small_vector_opt.html" title="Struct template get_small_vector_opt">dtl::get_small_vector_opt</a><span class="special">&lt;</span> <span class="identifier">Options</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span>                                       <a name="boost.container.small_vector_base.options_t"></a><span class="identifier">options_t</span><span class="special">;</span>           
  <span class="keyword">typedef</span> <a class="link" href="dtl/vector_for_small_vector.html" title="Struct template vector_for_small_vector">dtl::vector_for_small_vector</a><span class="special">&lt;</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">SecAlloc</span><span class="special">,</span> <span class="identifier">Options</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span>                       <a name="boost.container.small_vector_base.base_type"></a><span class="identifier">base_type</span><span class="special">;</span>           
  <span class="keyword">typedef</span> <a class="link" href="allocator_traits.html" title="Struct template allocator_traits">allocator_traits</a><span class="special">&lt;</span> <span class="identifier">allocator_type</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">pointer</span>                                      <a name="boost.container.small_vector_base.pointer"></a><span class="identifier">pointer</span><span class="special">;</span>             
  <span class="keyword">typedef</span> <a class="link" href="allocator_traits.html" title="Struct template allocator_traits">allocator_traits</a><span class="special">&lt;</span> <span class="identifier">allocator_type</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">const_pointer</span>                                <a name="boost.container.small_vector_base.const_pointer"></a><span class="identifier">const_pointer</span><span class="special">;</span>       
  <span class="keyword">typedef</span> <a class="link" href="allocator_traits.html" title="Struct template allocator_traits">allocator_traits</a><span class="special">&lt;</span> <span class="identifier">allocator_type</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">void_pointer</span>                                 <a name="boost.container.small_vector_base.void_pointer"></a><span class="identifier">void_pointer</span><span class="special">;</span>        
  <span class="keyword">typedef</span> <a class="link" href="allocator_traits.html" title="Struct template allocator_traits">allocator_traits</a><span class="special">&lt;</span> <span class="identifier">allocator_type</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">const_void_pointer</span>                           <a name="boost.container.small_vector_base.const_void_pointer"></a><span class="identifier">const_void_pointer</span><span class="special">;</span>  
  <span class="keyword">typedef</span> <a class="link" href="small_vector_allocator.html" title="Class template small_vector_allocator">small_vector_allocator</a><span class="special">&lt;</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">void_allocator_t</span><span class="special">,</span> <span class="identifier">Options</span> <span class="special">&gt;</span>                           <a name="boost.container.small_vector_base.small_allocator_type"></a><span class="identifier">small_allocator_type</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="small_vector_base.html#boost.container.small_vector_baseconstruct-copy-destruct">construct/copy/destruct</a></span>
  <span class="keyword">explicit</span> <a class="link" href="small_vector_base.html#idm24680-bb"><span class="identifier">small_vector_base</span></a><span class="special">(</span><span class="identifier">initial_capacity_t</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> AllocFwd<span class="special">&gt;</span> 
    <span class="keyword">explicit</span> <a class="link" href="small_vector_base.html#idm24685-bb"><span class="identifier">small_vector_base</span></a><span class="special">(</span><span class="identifier">initial_capacity_t</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">,</span> <span class="identifier">AllocFwd</span> <span class="special">&amp;&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">explicit</span> <a class="link" href="small_vector_base.html#idm24694-bb"><span class="identifier">small_vector_base</span></a><span class="special">(</span><span class="identifier">maybe_initial_capacity_t</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">,</span> 
                             <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> AllocFwd<span class="special">&gt;</span> 
    <span class="keyword">explicit</span> <a class="link" href="small_vector_base.html#idm24701-bb"><span class="identifier">small_vector_base</span></a><span class="special">(</span><span class="identifier">maybe_initial_capacity_t</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">,</span> 
                               <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">,</span> <span class="identifier">AllocFwd</span> <span class="special">&amp;&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="small_vector_base.html" title="Class template small_vector_base">small_vector_base</a> <span class="special">&amp;</span> <a class="link" href="small_vector_base.html#idm24718-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="small_vector_base.html" title="Class template small_vector_base">small_vector_base</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="small_vector_base.html" title="Class template small_vector_base">small_vector_base</a> <span class="special">&amp;</span> <a class="link" href="small_vector_base.html#idm24724-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><a class="link" href="small_vector_base.html" title="Class template small_vector_base">small_vector_base</a> <span class="special">&amp;&amp;</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="small_vector_base.html#idm24668-bb">private member functions</a></span>
  <span class="identifier">const_pointer</span> <a class="link" href="small_vector_base.html#idm24669-bb"><span class="identifier">internal_storage</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="identifier">pointer</span> <a class="link" href="small_vector_base.html#idm24671-bb"><span class="identifier">internal_storage</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <a class="link" href="small_vector_base.html#boost.container.small_vector_base.base_type">base_type</a> <span class="special">&amp;</span> <a class="link" href="small_vector_base.html#idm24673-bb"><span class="identifier">as_base</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">const</span> <a class="link" href="small_vector_base.html#boost.container.small_vector_base.base_type">base_type</a> <span class="special">&amp;</span> <a class="link" href="small_vector_base.html#idm24676-bb"><span class="identifier">as_base</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="small_vector_base.html#idm24712-bb">public member functions</a></span>
  <span class="keyword">void</span> <a class="link" href="small_vector_base.html#idm24713-bb"><span class="identifier">swap</span></a><span class="special">(</span><a class="link" href="small_vector_base.html" title="Class template small_vector_base">small_vector_base</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="id-1.3.9.14.37.10.4"></a><h2>Description</h2>
<p>This class consists of common code from all small_vector&lt;T, N&gt; types that don't depend on the "N" template parameter. This class is non-copyable and non-destructible, so this class typically used as reference argument to functions that read or write small vectors. Since <code class="computeroutput"><a class="link" href="small_vector.html" title="Class template small_vector">small_vector</a>&lt;T, N&gt;</code> derives from <code class="computeroutput"><a class="link" href="small_vector_base.html" title="Class template small_vector_base">small_vector_base</a>&lt;T&gt;</code>, the conversion to <code class="computeroutput"><a class="link" href="small_vector_base.html" title="Class template small_vector_base">small_vector_base</a></code> is implicit </p>
<pre class="programlisting">

<span class="comment">//Clients can pass any small_vector&lt;Foo, N&gt;.</span>
<span class="keyword">void</span> <span class="identifier">read_any_small_vector_of_foo</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">small_vector_base</span><span class="special">&lt;</span><span class="identifier">Foo</span><span class="special">&gt;</span> <span class="special">&amp;</span><span class="identifier">in_parameter</span><span class="special">)</span><span class="special">;</span>

<span class="keyword">void</span> <span class="identifier">modify_any_small_vector_of_foo</span><span class="special">(</span><span class="identifier">small_vector_base</span><span class="special">&lt;</span><span class="identifier">Foo</span><span class="special">&gt;</span> <span class="special">&amp;</span><span class="identifier">in_out_parameter</span><span class="special">)</span><span class="special">;</span>

<span class="keyword">void</span> <span class="identifier">some_function</span><span class="special">(</span><span class="special">)</span>
<span class="special">{</span>

   <span class="identifier">small_vector</span><span class="special">&lt;</span><span class="identifier">Foo</span><span class="special">,</span> <span class="number">8</span><span class="special">&gt;</span> <span class="identifier">myvector</span><span class="special">;</span>

   <span class="identifier">read_any_small_vector_of_foo</span><span class="special">(</span><span class="identifier">myvector</span><span class="special">)</span><span class="special">;</span>   <span class="comment">// Reads myvector</span>

   <span class="identifier">modify_any_small_vector_of_foo</span><span class="special">(</span><span class="identifier">myvector</span><span class="special">)</span><span class="special">;</span> <span class="comment">// Modifies myvector</span>

<span class="special">}</span>
</pre>
<p>All <code class="computeroutput">boost::container:vector</code> member functions are inherited. See <code class="computeroutput">vector</code> documentation for details. </p>
<div class="refsect2">
<a name="id-1.3.9.14.37.10.4.4"></a><h3>
<a name="boost.container.small_vector_baseconstruct-copy-destruct"></a><code class="computeroutput">small_vector_base</code> 
        public
       construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><pre class="literallayout"><span class="keyword">explicit</span> <a name="idm24680-bb"></a><span class="identifier">small_vector_base</span><span class="special">(</span><span class="identifier">initial_capacity_t</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> initial_capacity<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> AllocFwd<span class="special">&gt;</span> 
  <span class="keyword">explicit</span> <a name="idm24685-bb"></a><span class="identifier">small_vector_base</span><span class="special">(</span><span class="identifier">initial_capacity_t</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> capacity<span class="special">,</span> 
                             <span class="identifier">AllocFwd</span> <span class="special">&amp;&amp;</span> a<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">explicit</span> <a name="idm24694-bb"></a><span class="identifier">small_vector_base</span><span class="special">(</span><span class="identifier">maybe_initial_capacity_t</span><span class="special">,</span> 
                           <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> initial_capacity<span class="special">,</span> 
                           <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> initial_size<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> AllocFwd<span class="special">&gt;</span> 
  <span class="keyword">explicit</span> <a name="idm24701-bb"></a><span class="identifier">small_vector_base</span><span class="special">(</span><span class="identifier">maybe_initial_capacity_t</span><span class="special">,</span> 
                             <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> initial_capacity<span class="special">,</span> 
                             <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> initial_size<span class="special">,</span> <span class="identifier">AllocFwd</span> <span class="special">&amp;&amp;</span> a<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><a class="link" href="small_vector_base.html" title="Class template small_vector_base">small_vector_base</a> <span class="special">&amp;</span> <a name="idm24718-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="small_vector_base.html" title="Class template small_vector_base">small_vector_base</a> <span class="special">&amp;</span> other<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><a class="link" href="small_vector_base.html" title="Class template small_vector_base">small_vector_base</a> <span class="special">&amp;</span> <a name="idm24724-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><a class="link" href="small_vector_base.html" title="Class template small_vector_base">small_vector_base</a> <span class="special">&amp;&amp;</span> other<span class="special">)</span><span class="special">;</span></pre></li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.9.14.37.10.4.5"></a><h3>
<a name="idm24668-bb"></a><code class="computeroutput">small_vector_base</code> private member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><pre class="literallayout"><span class="identifier">const_pointer</span> <a name="idm24669-bb"></a><span class="identifier">internal_storage</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">pointer</span> <a name="idm24671-bb"></a><span class="identifier">internal_storage</span><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><a class="link" href="small_vector_base.html#boost.container.small_vector_base.base_type">base_type</a> <span class="special">&amp;</span> <a name="idm24673-bb"></a><span class="identifier">as_base</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">const</span> <a class="link" href="small_vector_base.html#boost.container.small_vector_base.base_type">base_type</a> <span class="special">&amp;</span> <a name="idm24676-bb"></a><span class="identifier">as_base</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.9.14.37.10.4.6"></a><h3>
<a name="idm24712-bb"></a><code class="computeroutput">small_vector_base</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><pre class="literallayout"><span class="keyword">void</span> <a name="idm24713-bb"></a><span class="identifier">swap</span><span class="special">(</span><a class="link" href="small_vector_base.html" title="Class template small_vector_base">small_vector_base</a> <span class="special">&amp;</span> other<span class="special">)</span><span class="special">;</span></pre></li></ol></div>
</div>
</div>
</div>
<div class="copyright-footer">Copyright © 2009-2018 Ion Gaztanaga<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="small_vector_allocator.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_header_reference.html#header.boost.container.small_vector_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="small_vector_storage.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
